package com.android.quiz.geek.utils;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.telephony.SmsManager;
import android.widget.Toast;

public class Utils
{
	public static boolean yesNoRetValue = false;

	
	public static void DisplayAlertDialog(Context context, String title, String message)
	{
		AlertDialog alertDialog = new AlertDialog.Builder(context).create();
		alertDialog.setTitle(title);
    alertDialog.setMessage(message);
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
        return;
    } }); 
    alertDialog.show();
	}
	
	public static void DisplayYesNoAlertDialog(Context context, String title, String message)
	{
		//final boolean retValue;
		AlertDialog alertDialog = new AlertDialog.Builder(context).create();
		alertDialog.setTitle(title);
    alertDialog.setMessage(message);
    alertDialog.setButton("Oui", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
      	yesNoRetValue = true;
        return;
    } });
    alertDialog.setButton2("Non", new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int which) {
      	yesNoRetValue = false;
        return;
    } });
    alertDialog.show();
	}
	
	public static void DisplayToast(Context context, String message, boolean longTime)
	{
		int time = Toast.LENGTH_SHORT;
		if (longTime == true)
			time = Toast.LENGTH_LONG;
		Toast.makeText(context, message,time).show();
	}
	
	
	
}
